package com.ruoyi.system.domain;

import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.IdClass;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 用户和角色关联 sys_user_role
 *
 * @author ruoyi
 */
@Entity
@IdClass(SysUserRole.class)
@Data
public class SysUserRole {
	/** 用户ID */
	@Id
	private Long userId;

	/** 角色ID */
	@Id
	private Long roleId;

	@Override
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
				.append("userId", getUserId())
				.append("roleId", getRoleId())
				.toString();
	}
}
